Skip to content

Bug Fixes: issues discovered during MC/DC coverage step 4#10973

Open
danielinux wants to merge 3 commits into
wolfSSL:masterfrom
danielinux:fixes-mcdc-step4
Open

Bug Fixes: issues discovered during MC/DC coverage step 4#10973
danielinux wants to merge 3 commits into
wolfSSL:masterfrom
danielinux:fixes-mcdc-step4

Conversation

@danielinux

Copy link
Copy Markdown
Member

Description

3x wolfcrypt bugfixes.

Testing

#10967

Checklist

  • added tests

Return early when inSz == 0, mirroring the other Ascon Update functions.
Initialize the mp_int temporaries as soon as they are allocated in
wc_CompareDiffPQ(), _CheckProbablePrime() and wc_CheckProbablePrime_ex(),
so the cleanup path handles them consistently in all cases.
Return 0 when all used digits are zero instead of scanning past them.
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 769,276 B / 1,048,576 B, total: 73% used)

gcc-arm-cortex-m4-pkcs7

  • FLASH: .text +64 B (+0.0%, 213,460 B / 262,144 B, total: 81% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +128 B (+0.0%, 280,128 B / 1,048,576 B, total: 27% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .text +128 B (+0.0%, 326,040 B / 1,048,576 B, total: 31% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +128 B (+0.1%, 236,807 B / 262,144 B, total: 90% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +128 B (+0.0%, 280,704 B / 1,048,576 B, total: 27% used)

gcc-arm-cortex-m7-tls13

@danielinux danielinux self-assigned this Jul 22, 2026
@philljj

philljj commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Retest this please.

(not clear what failed).

@philljj
philljj self-requested a review July 22, 2026 19:43
@philljj

philljj commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Retest this please.

windows test:

[0] Incorrect return -308
test_crl_monitor failed on iteration 0

@philljj philljj assigned wolfSSL-Bot and unassigned danielinux Jul 22, 2026

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread wolfcrypt/src/rsa.c
* allocated-but-uninitialized mp_int reads a garbage ->used and corrupts
* the heap. */
if (c != NULL)
XMEMSET(c, 0, sizeof(*c));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't like the XMEMSET.
The mp_init_multi should be doing that if necessary.
Don't want to be doing multiple mp_init calls either.
Is the XMEMSET really needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants